﻿
using ExtensionHelper;
namespace Expression
{ 
    using Interface;
    

    /// <summary>
    /// 
    /// </summary>
    public class ArgPoint : ArgBase
    { 
        /*
         point传入格式：(1,2)
         */

        /// <summary>
        /// 
        /// </summary>
        /// <param name="arg"></param>
        /// <param name="exp"></param>
        public override void Converter(IArg arg,IAlgorithmBehaviours exp)
        {
            this.Name = arg.Name;
            string temp = arg.Value.ToString().TrimStart('(').TrimEnd(')');
            string[] arr = temp.Split(',');

            Point pt = new Point(arr[0].ToDouble(),arr[1].ToDouble());
            exp.AddParameters(arg.Name, pt); 
        }
    }
}
